package com.neuedu.web.controller;

import com.neuedu.web.common.BaseMethodController;
import com.neuedu.web.common.PageInfo;
import com.neuedu.web.service.ConstantsTypeService;
import com.neuedu.web.vo.ConstantsTypeVO;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

/**
 * @author 金山
 * 项目：his
 * site: https://blog.fulfill.com.cn
 * 描述  ConstantsType接口
 * @data 2024-11-21 14:21:592
 */
@WebServlet(urlPatterns = "/constants_type/*")
public class ConstantsTypeController extends BaseMethodController {

    private ConstantsTypeService constantsTypeService = new ConstantsTypeService();


    /**
     * 分页查询
     * @param request
     * @param response
     * @return
     * @throws IOException
     * @throws NoSuchFieldException
     * @throws InvocationTargetException
     * @throws NoSuchMethodException
     * @throws InstantiationException
     * @throws IllegalAccessException
     */
    private PageInfo<ConstantsTypeVO> page(HttpServletRequest request , HttpServletResponse response) throws IOException, NoSuchFieldException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
        return constantsTypeService.page(request,response);
    }


    /**
     * 添加或更新
     * @param request
     * @param response
     * @return
     * @throws IOException
     */
    public boolean saveOrUpdate(HttpServletRequest request ,HttpServletResponse response) throws IOException {
        return constantsTypeService.saveOrUpdate(request,response);
    }


    /**
     * 删除
     * @param request
     * @param response
     * @return
     * @throws IOException
     */
    public boolean delete(HttpServletRequest request ,HttpServletResponse response) throws IOException {
        return constantsTypeService.delete(request,response);
    }

    public ConstantsTypeVO getById(HttpServletRequest request ,HttpServletResponse response) throws IOException, NoSuchFieldException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
        return constantsTypeService.getById(request,response);
    }


}
